package com.dubbo.cp.consumer.controller;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.dubbo.cp.service.DemoService;
import com.dubbo.cp.service.PayService;
import com.dubbo.cp.service.UserService;



@RestController
public class DemoConsumerController {
    @Reference
    /*(version = "${demo.service.version}",
            application = "${dubbo.application.id}",
            url = "dubbo://localhost:20880")
            */
    private DemoService demoServiceImpl;

    @Reference
    private UserService userServiceImpl;
    
    @Reference
    private PayService payService;
    
    @RequestMapping("/sayHello")
    public String sayHello() {
        return demoServiceImpl.sayHello();
    }
    @RequestMapping("/getUser")
    public String getUser() {
        return userServiceImpl.getUser();
    }
    
    
    @RequestMapping("/doPay")
    public String doPay() {
    	payService.doPay();
        return "doPay";
    }
}
